package com.link2room.aeriabots.controller.inside;

import com.link2room.aeriabots.dto.param.inside.WxScanCountDetailFindParamDto;
import com.link2room.aeriabots.facade.IWxScanCountFacadeService;
import com.link2room.common.dto.result.base.BaseResultDto;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by LN on 2017/11/21
 */
@RestController
@RequestMapping("/in/WxQrcodeScanDetail")
public class WxScanCountDetailController {
    @Resource
    private IWxScanCountFacadeService wxScanCountFacadeService;


    @RequestMapping(method = RequestMethod.GET)
    public BaseResultDto getWxScanCountDetail(
            @RequestParam(name = "openid", required = false) String openid,
            @RequestParam(name = "qrType", required = false) String qrType,
            @RequestParam(name = "qrKey", required = false) String qrKey,
            @RequestParam(name = "scanType", required = false) String scanType
    ) throws Exception {
        WxScanCountDetailFindParamDto paramDto = new WxScanCountDetailFindParamDto();
        paramDto.setQrKey(qrKey);
        paramDto.setQrType(qrType);
        paramDto.setScanType(scanType);
        paramDto.setOpenid(openid);
        BaseResultDto res = new BaseResultDto();
        res.setResultCode(0);
        res.setQueryResult(wxScanCountFacadeService.findScanCountDetail(paramDto));
        return res;
    }


}
